package com.dlc.beijingrfid.activity;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.TextView;

import com.dlc.commonlibrary.widget.TitleBar;
import com.dlc.beijingrfid.R;
import com.dlc.beijingrfid.adapter.DistributeOddDetailAdapter;
import com.dlc.beijingrfid.base.BaseActivity;
import com.dlc.beijingrfid.net.bean.DistributeOrderDetailBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by Administrator on 2017/7/19 0019.
 */

public class DistributeOddDetailActivity extends BaseActivity {
    @BindView(R.id.titleBar)
    TitleBar titleBar;
    @BindView(R.id.odd_detail_rv)
    RecyclerView odd_detail_rv;
    @BindView(R.id.order_time)
    TextView order_time;
    @BindView(R.id.floor)
    TextView floor_tv;
    private DistributeOddDetailAdapter oddDetailAdapter;
    private List<DistributeOrderDetailBean.DataBean.DetailBean> orderBeanList=new ArrayList<>();
    @Override
    protected int getLayoutID() {
        return R.layout.activity_distribute_odd_detail;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        titleBar.leftExit(this);
        Bundle bundle =getIntent().getExtras();
        DistributeOrderDetailBean orderDetailBean= (DistributeOrderDetailBean) bundle.getSerializable("detailData");
        order_time.setText(orderDetailBean.data.ctime);
        floor_tv.setText(orderDetailBean.data.floor_id);
        for(int i=0;i<orderDetailBean.data.detail.size();i++){
            DistributeOrderDetailBean.DataBean.DetailBean dataBean=orderDetailBean.data.detail.get(i);
            orderBeanList.add(dataBean);
            Log.d("category-------->",dataBean.category);
        }
        odd_detail_rv.setLayoutManager(new LinearLayoutManager(this));
        oddDetailAdapter=new DistributeOddDetailAdapter(this,orderBeanList);
        odd_detail_rv.setAdapter(oddDetailAdapter);

    }
}
